<?php
	if(isset($_POST["nombre"]) && isset($_POST["email"])){
	
		include_once("../model/RegistroService.php");
		$service = new RegistroService();
		
		$user = new Usuario();
		$user->nombre = $_POST["nombre"];
		$user->email = $_POST["email"];
		
		if($service->checkEmail($user->email)){
			if($service->registrar($user)){
				header("Location:".Conexion::URL_BASE."/registro/exito");
			}
		}else{
			header("Location:".Conexion::URL_BASE."/registro/error");
		}
	
	}
?>